package com.tts.superstar;

import android.app.Activity;
import android.app.ActivityManager;
import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;

import com.tts.superstar.Tools.ActivityList;
import com.tts.superstar.View.BaseActivity;

public class YouraccountActivity extends BaseActivity {
    private ImageButton imageButton;
    private Button button;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_youraccount);

        imageButton = findViewById(R.id.ff);
        imageButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        final SharedPreferences sharedPreferences = getSharedPreferences("account",MODE_PRIVATE);
        TextView textView = findViewById(R.id.ww);
        textView.setText(sharedPreferences.getString("User",null));

        button = findViewById(R.id.oo);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(YouraccountActivity.this,LoginActivity.class);
                ActivityList.finishAll();
                SharedPreferences.Editor editor = sharedPreferences.edit();
                editor.putString("User",null);
                editor.putBoolean("isLogin",false);
                editor.apply();
                startActivity(intent);
            }
        });

    }
}
